<template>
  <Nav :showBlack="true" title="长江颂·茶道套盒"></Nav>
  <div class="page">
    <div class="lookBox">
      <vue3dLoader
          filePath="/models/collada/stormtrooper/stormtrooper.dae"
          :height="width3D"
          :width="width3D"
      ></vue3dLoader>
    </div>
    <div class="itemSwiper">
      <div class="items-info">
        <div class="info-title">
          <span class="name">茶经</span>
          <span>
             <img src="../assets/like.png" alt="">
             12
           </span>
        </div>
        <div class="f-title">
          宣纸载茶经，手礼传古韵。
        </div>
      </div>
    </div>
    <van-swipe  ref="swiperItem" type="card" :height="lang" :width="lang" :loop="false" :show-indicators="false">
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 0}" style="background: pink"  @click="goThis(0)"></div>
      </van-swipe-item>
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 1}" style="background: pink" @click="goThis(1)"></div>
      </van-swipe-item>
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 2}" style="background: pink" @click="goThis(2)"></div>
      </van-swipe-item>
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 3}" style="background: pink"  @click="goThis(3)"></div>
      </van-swipe-item>
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 4}" style="background: pink" @click="goThis(4)"></div>
      </van-swipe-item>
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 5}" style="background: pink" @click="goThis(5)"></div>
      </van-swipe-item>
    </van-swipe>
    <div class="infoBox">
       <div class="infoList">
         <div class="contrBox" @click="toggleOpen">
           <img v-show="open" src="../assets/down.png" alt="">
           <img v-show="!open" src="../assets/up.png" alt="">
         </div>
         <div class="head">
           <div class="name">宣纸载茶经，手礼传古韵</div>
           <div class="spec" v-show="open">材质：宣纸</div>
           <div class="spec" v-show="open">尺寸：30×185mm</div>
         </div>
         <div class="body">
            <div class="title">
              藏品介绍
            </div>
           <div class="cont" :class="{close:!open}">
             <div class="p">
               宣纸茶经作为文创伴手礼，其文化寓意体现在对传统文化的尊重与传承、艺术与生活的和谐统一、传承与创新的结合以及深厚的情感寓意等方面。
             </div>
             <div class="p">它不仅是一份具有独特魅力的文化产品，更是一份能够传递文化价值和情感纽带的珍贵礼物。</div>
           </div>
           <div class="likeBox">
             <img src="../assets/collect.png" alt="">
             点赞藏品
           </div>
         </div>
       </div>
    </div>
  </div>
</template>
<script setup>
import { useRouter } from 'vue-router'
import { ref, onMounted } from 'vue';
import Nav from '@/components/nav.vue'
const swiperTop = ref(null)
const swiperItem = ref(null)
const router = useRouter();
const swiperIndex = ref(0);
const lang =  window.innerWidth / 1080 * 280
const width3D = window.innerWidth / 1080 * 600
const open = ref(false)

const goDetail = () => {
  router.push({path:'detail'})
}

const goThis = (index) => {
  // console.log(swiperTop)
  swiperIndex.value = index;
}

const toggleOpen = () => {
  open.value = !open.value;
}
</script>
<style scoped lang="scss">
@import '@/assets/style/mixin';
.page {
  background: #0f1830;
  padding-top: 170px;
  padding-bottom: 200px;
  color:#fff;
}
.lookBox {
  display: flex;
  padding: 30px 0 80px 0;
  @include center();
}
.main-info {
  width: 100%;
  padding:0 58px;
  background: #0a0f18;
  .imgBox {
    width: 100%;
    height: 722px;
    border-radius: 24px;
    margin-bottom: 50px;
  }
}
.nameBox {
  display: flex;
  justify-content: space-between;
  height: 90px;
  .name {
    font-size: 46px;
  }
  .control {
    display: flex;
    justify-content: space-between;
    height: 90px;
    > div {
      margin-left: 40px;
      font-size: 40px;
      img {
        height: 40px;
        width: auto;
        margin-right:10px;
        vertical-align: text-bottom;
      }
    }
  }
}
.tags {
  overflow: hidden;
  margin-bottom: 20px;
  .tag {
    float: left;
    font-size:32px;
    background: #f4eacf;
    color:#040810;
    font-weight: bold;
    padding: 10px 16px;
    border-radius: 10px;
    margin-right: 20px;
  }
}
.info {
  font-size: 36px;
  line-height: 2;
  margin-bottom: 20px;
}

.controlBox {
  border:3PX solid #f4eacf;
  border-radius: 20px;
  padding: 42px 0;
  display: flex;
  margin-bottom: 40px;
  .cont {
    flex: 1;
    height: 30px;
    font-size: 36px;
    color:#f4eacf;
    display: flex;
    justify-content: center;
    align-items: center;
    img {
      margin-right: 16px;
      height: 50px;
    }
    &.border {
      border-right: 3PX solid #f4eacf;
    }
  }
}
.itemSwiper {
  padding: 0  50px;
  .s-title {
    display: flex;
    justify-content: space-between;
    font-size: 38px;
    margin-bottom: 80px;
  }
  .swiperBox {
    display: flex;
    margin-right: -30px;
    margin-left: -30px;
    margin-bottom: 46px;
    .leftBr {
      flex:1;
      height: 873px;
      @include center();
      img {
        width: 76px;
        height: 76px;
      }
    }
    .rightBr {
      flex:1;
      height: 873px;
      @include center();
      img {
        width: 76px;
        height: 76px;
      }
    }
    .inner {
      width: 680px;
      height: 873px;
      flex:none;
      background: pink;
    }
  }
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
  height: 873px;
}
.items-info {
  .info-title {
    font-size: 40px;
    margin-bottom: 30px;
    img {
      width: 42px;
    }
    .name {
      font-size: 46px;
      margin-right: 42px;
    }
    @include center();
  }
  .f-title {
    font-size: 40px;
    margin-bottom: 60px;
    @include center();
  }
  .btns {
    margin-bottom: 60px;
    @include center();
    .btn {
      font-size: 40px;
      padding: 25px;
      border:3px solid #fff;
      width: 320px;
      border-radius: 15px;
      @include center()
    }
  }
}
.van-swipe-item {
  display: flex;
  background: yellow;
  @include center();
}
.imgBoxInner {
  width: 80%;
  height: 80%;
  background: pink;
  border-radius: 14px;
  &.big {
    width: 94%;
    height: 94%;
  }
}
.courseBlock {
  padding: 42px 58px;
  .head {
    font-size: 46px;
    margin-bottom: 60px;
  }
}

.item {
  border:1px solid #484a4a;
  border-radius: 34px;
  padding: 40px;
  margin-bottom: 40px;
  display: flex;
  .imgbox {
    width: 146px;
    height: 146px;
    border-radius:15px;
    background: pink;
    flex: none;
  }
  .infoBox {
    margin-left: 40px;

    .info-title {
      font-size: 46px;
      margin-bottom: 15px;
    }
    .info-minTitle {
      font-size: 32px;
      line-height: 1.3;
      @include ellipsis2(2)
    }
  }
}
.infoBox {
  padding-top: 44px;
  padding-left: 64px;
  padding-right:64px;
  .infoList {
     width: 100%;
     background: #f6f0e6;
     padding: 40px;
     border-radius: 40px;
     font-weight: bold;
     position: relative;
    .contrBox {
      position: absolute;
      right:0;
      top:0px;
      width: 100px;
      height: 100px;
      img{
        width: 50px;
        height: 50px;
      }
      @include center();
    }
    .head {
       color:#050911;
       font-size: 46px;
       margin-bottom: 20px;
      .name {
        margin-bottom: 20px;
      }
      .spec {
        font-size: 32px;
        margin-bottom: 12px;
      }

    }
    .body {
      .title {
        color:#040810;
        font-size: 34px;
        margin-bottom: 20px;
        font-weight: bold;
        padding-top: 20px;
      }
      .cont {
        margin-bottom: 30px;
        &.close {
          height: 96px;
          overflow: hidden;
        }
      }
      .p {
        font-size: 32px;
        color:#040810;
        line-height: 1.4;
      }

    }
  }
  .likeBox {
    height: 100px;
    color:#040810;
    font-size: 46px;
    img {
      height: 50px;
      margin-right: 10px;
    }
    @include center();
  }
}
</style>
